package com.aaa.cs.controller;

import com.aaa.common.util.Result;
import com.aaa.cs.entity.CarTypeConfigDetails;
import com.aaa.cs.service.CarTypeConfigDetailsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * (CarTypeConfigDetails)表控制层
 *
 * @author makejava
 * @since 2020-11-18 15:47:55
 */
@RestController
@RequestMapping("carTypeConfigDetails")
public class CarTypeConfigDetailsController {
    /**
     * 服务对象
     */
    @Resource
    private CarTypeConfigDetailsService carTypeConfigDetailsService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public Result selectOne(Integer id) {
        return this.carTypeConfigDetailsService.queryById(id);
    }

    /**
     * 分页加各种条件查询
     * @param pageNo
     * @param pageSize
     * @param carTypeConfigDetails
     * @return
     */
    @GetMapping("queryPageByParam")
    public Result queryPageByParam(Integer pageNo, Integer pageSize, CarTypeConfigDetails carTypeConfigDetails){
        return carTypeConfigDetailsService.queryPageByParam(pageNo,pageSize,carTypeConfigDetails);
    }

    @GetMapping("deleteById")
    public Result deleteById(Integer id){
        return carTypeConfigDetailsService.deleteById(id);
    }

    @GetMapping("insertOrUpdate")
    public Result insertOrUpdate(CarTypeConfigDetails carTypeConfigDetails){
        return carTypeConfigDetailsService.insertOrUpdate(carTypeConfigDetails);
    }

    @GetMapping("queryAll")
    public Result queryAll(CarTypeConfigDetails carTypeConfigDetails){
        return carTypeConfigDetailsService.queryAll(carTypeConfigDetails);
    }
}